//
//  Float+Externsion.swift
//  MikerShop
//
//  Created by eme on 2016/12/14.
//  Copyright © 2016年 eme. All rights reserved.
//

import Foundation

extension Double {
    /// 返回价格显示的字符串
    public func auth_getPriceStr() -> String {
        guard let user = AppData.loginedUser ,user.thrState == "1" else {
            return "￥***"
        }
        return String(format: "￥%.2f", self)
    }
    /// 保留两位小数
    public func auth_getFormatStr() -> String {
        guard let user = AppData.loginedUser ,user.thrState == "1" else {
            return "***"
        }
        return String(format: "%.2f", self)
    }
}
